const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    mode: "production",
    entry: './src/index.jsx',
    output: {
        path: path.resolve(__dirname, 'dist'),
        publicPath: "/",
        filename: 'app.bundle.js'
    },
    module: {
        rules: [
            { test: /\.jsx?$/, use: 'babel-loader' },
            { test: /\.s?css$/, use: ['style-loader','css-loader','postcss-loader','sass-loader']}
        ]
    },
    resolve: {
        extensions: ['.js','.jsx','.json']
    },
    plugins: [
        new HTMLWebpackPlugin({
            filename: 'index.html',
            template: './index.html',
            inject:true
        })
    ]
};